import static org.junit.Assert.assertEquals;

import org.junit.Assert;
import org.junit.Test;

//import DVD.Status;


public class TestDVD {
	
	@Test
	public void testEqualsTrue() throws Exception
	{
		DVD dvd = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 0);
		DVD compare = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 0);
		
		Assert.assertTrue(dvd.equals(compare));
	}
	
	@Test
	public void testEqualsFalse() throws Exception
	{
		DVD dvd = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 0);
		DVD compare = new DVD(DVD.Status.RENTAL, "Sample Sale", 1, 0);
		
		Assert.assertFalse(dvd.equals(compare));
	}
	
	@Test
	public void testConstructorA() 
	{
		DVD a = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 1.00);
		//check Status
		assertEquals(DVD.Status.RENTAL, a.getStatus());
		//check name
		assertEquals("Sample Rental", a.getTitle());
		//check quantity
		assertEquals(1, a.getQuantity());
		//check price
		assertEquals(1.00, a.getPrice(), 0.1);
		//check Number
	}
	
	@Test 
	public void testSetQuantity() 
	{
		DVD a = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 1.00);
		a.setQuantity(10);
		//check quantity
		assertEquals(10, a.getQuantity());
	}
	
	@Test
	public void testSetPrice() 
	{
		DVD a = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 1.00);
		a.setPrice (10.00);
		//check price
		assertEquals(10.00, a.getPrice(), 0.1);
	}
	
	@Test 
	public void testSetTitle() 
	{
		DVD a = new DVD(DVD.Status.RENTAL, "James Bond", 1, 1.00);
		a.setTitle("Gold Member");
		// check title
		assertEquals("Gold Member", a.getTitle());
	}
	
	@Test
	public void testSetStatus() 
	{
		DVD a = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 1.00);
		a.setStatus(DVD.Status.SALE);
		//check status
		assertEquals(DVD.Status.SALE, a.getStatus());
	}
	public void testToString()
	{
		DVD a = new DVD(DVD.Status.RENTAL, "Sample Rental", 1, 1);
		//check toString()
		assertEquals("02 Sample Rental             002 R 000.00", a.toString());
	}
	
}
